package com.heima.wemedia.feign;

import com.heima.model.admin.dtos.ChannelDto;
import com.heima.model.admin.dtos.SensitiveDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmChannelService;
import com.heima.wemedia.service.WmSensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//@RestController
public class AdminaddChanneClient {
    @Autowired
    private WmChannelService wmChannelService;
    @PostMapping("/admin/api/v1/channel/save")
    public ResponseResult addchannel(@RequestBody WmChannel wmChannel){
        return wmChannelService.add(wmChannel);
    }
    @PostMapping("/admin/api/v1/channel/list")
    public ResponseResult getList(@RequestBody ChannelDto channelDto){
        return wmChannelService.PageByquerywapper(channelDto);
    }
    @GetMapping("/admin/api/v1/channel/del/{id}")
    public ResponseResult delete(@PathVariable Integer id){
       return   wmChannelService.deleteById(id);
    }

    @PostMapping("/admin/api/v1/channel/update")
    public ResponseResult updatechannel(@RequestBody WmChannel channel){
        return wmChannelService.updatechannel(channel);
    }
    //---------敏感词-------------
//    @Autowired
//    private WmSensitiveService wmSensitiveService;
//
//    @PostMapping("/admin/api/v1/sensitive/save")
//    public ResponseResult addsensitive(@RequestBody WmSensitive wmSensitive) {
//        return wmSensitiveService.addSensitive(wmSensitive);
//    }
//    @PostMapping("/admin/api/v1/sensitive/list")
//    ResponseResult getList(@RequestBody SensitiveDto sensitiveDto){
//        return wmSensitiveService.getSensitiveList(sensitiveDto);
//    }
//    @PostMapping("/admin/api/v1/channel/update")
//    ResponseResult updateSensitive(@RequestBody WmSensitive wmSensitive){
//        return wmSensitiveService.updateSensitive(wmSensitive);
//    }
}
